function bnet = mk_alarm()
N=37;
dag = zeros(37,37);
dag(23,13)=1;
dag(1,13)=1;
dag(2,14)=1;
dag(36,14)=1;
dag(8,15)=1;
dag(3,15)=1;
dag(3,16)=1;
dag(8,16)=1;
dag(3,17)=1;
dag(4,18)=1;
dag(13,18)=1;
dag(5,18)=1;
dag(4,19)=1;
dag(5,19)=1;
dag(13,19)=1;
dag(18,20)=1;
dag(5,20)=1;
dag(5,21)=1;
dag(18,21)=1;
dag(10,22)=1;
dag(5,22)=1;
dag(6,23)=1;
dag(21,24)=1;
dag(7,24)=1;
dag(9,25)=1;
dag(35,25)=1;
dag(27,25)=1;
dag(34,25)=1;
dag(10,26)=1;
dag(11,27)=1;
dag(36,28)=1;
dag(12,28)=1;
dag(36,29)=1;
dag(12,29)=1;
dag(15,30)=1;
dag(15,31)=1;
dag(36,32)=1;
dag(16,32)=1;
dag(34,33)=1;
dag(18,33)=1;
dag(21,34)=1;
dag(22,35)=1;
dag(24,35)=1;
dag(25,36)=1;
dag(32,37)=1;
dag(27,37)=1;
node_sizes= zeros(1,37);
node_sizes(1)=2;
node_sizes(2)=2;
node_sizes(3)=2;
node_sizes(4)=2;
node_sizes(5)=3;
node_sizes(6)=3;
node_sizes(7)=2;
node_sizes(8)=2;
node_sizes(9)=2;
node_sizes(10)=2;
node_sizes(11)=2;
node_sizes(12)=2;
node_sizes(13)=4;
node_sizes(14)=3;
node_sizes(15)=3;
node_sizes(16)=3;
node_sizes(17)=2;
node_sizes(18)=4;
node_sizes(19)=4;
node_sizes(20)=4;
node_sizes(21)=4;
node_sizes(22)=2;
node_sizes(23)=4;
node_sizes(24)=3;
node_sizes(25)=2;
node_sizes(26)=3;
node_sizes(27)=3;
node_sizes(28)=3;
node_sizes(29)=3;
node_sizes(30)=3;
node_sizes(31)=3;
node_sizes(32)=3;
node_sizes(33)=4;
node_sizes(34)=3;
node_sizes(35)=3;
node_sizes(36)=3;
node_sizes(37)=3;
bnet = mk_bnet(dag, node_sizes);
CPT= zeros(2,1);
CPT(1)=0.05;
CPT(2)=0.95;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{1} = tabular_CPD(bnet, 1, 'CPT', CPT);
CPT= zeros(2,1);
CPT(1)=0.05;
CPT(2)=0.95;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{2} = tabular_CPD(bnet, 2, 'CPT', CPT);
CPT= zeros(2,1);
CPT(2)=0.95;
CPT(1)=0.05;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{3} = tabular_CPD(bnet, 3, 'CPT', CPT);
CPT= zeros(2,1);
CPT(1)=0.04;
CPT(2)=0.96;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{4} = tabular_CPD(bnet, 4, 'CPT', CPT);
CPT= zeros(3,1);
CPT(2)=0.03;
CPT(3)=0.05;
CPT(1)=0.92;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{5} = tabular_CPD(bnet, 5, 'CPT', CPT);
CPT= zeros(3,1);
CPT(2)=0.98;
CPT(1)=0.01;
CPT(3)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{6} = tabular_CPD(bnet, 6, 'CPT', CPT);
CPT= zeros(2,1);
CPT(2)=0.99;
CPT(1)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{7} = tabular_CPD(bnet, 7, 'CPT', CPT);
CPT= zeros(2,1);
CPT(2)=0.8;
CPT(1)=0.2;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{8} = tabular_CPD(bnet, 8, 'CPT', CPT);
CPT= zeros(2,1);
CPT(1)=0.2;
CPT(2)=0.8;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{9} = tabular_CPD(bnet, 9, 'CPT', CPT);
CPT= zeros(2,1);
CPT(2)=0.99;
CPT(1)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{10} = tabular_CPD(bnet, 10, 'CPT', CPT);
CPT= zeros(2,1);
CPT(2)=0.99;
CPT(1)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{11} = tabular_CPD(bnet, 11, 'CPT', CPT);
CPT= zeros(2,1);
CPT(1)=0.1;
CPT(2)=0.9;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{12} = tabular_CPD(bnet, 12, 'CPT', CPT);
CPT= zeros(2, 4, 4);
CPT(1,4,4)=0.01;
CPT(1,4,2)=0.01;
CPT(1,3,3)=0.01;
CPT(2,3,1)=0.01;
CPT(1,3,2)=0.01;
CPT(1,2,4)=0.01;
CPT(1,1,4)=0.01;
CPT(2,1,3)=0.01;
CPT(2,1,4)=0.01;
CPT(1,2,1)=0.97;
CPT(2,3,2)=0.01;
CPT(2,3,4)=0.01;
CPT(2,1,1)=0.97;
CPT(1,1,3)=0.01;
CPT(1,1,1)=0.97;
CPT(1,1,2)=0.01;
CPT(2,2,4)=0.01;
CPT(2,2,3)=0.01;
CPT(1,3,1)=0.97;
CPT(1,4,3)=0.01;
CPT(2,4,2)=0.01;
CPT(1,4,1)=0.97;
CPT(2,4,3)=0.01;
CPT(2,3,3)=0.97;
CPT(2,1,2)=0.01;
CPT(2,4,1)=0.01;
CPT(2,4,4)=0.97;
CPT(1,2,2)=0.01;
CPT(1,3,4)=0.01;
CPT(1,2,3)=0.01;
CPT(2,2,2)=0.97;
CPT(2,2,1)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{13} = tabular_CPD(bnet, 13, 'CPT', CPT);
CPT= zeros(2, 3, 3);
CPT(2,1,1)=0.98;
CPT(1,2,3)=0.01;
CPT(1,3,1)=0.3;
CPT(1,2,1)=0.4;
CPT(1,2,2)=0.59;
CPT(2,3,2)=0.01;
CPT(2,1,2)=0.01;
CPT(2,2,2)=0.98;
CPT(2,3,3)=0.98;
CPT(1,3,2)=0.4;
CPT(2,3,1)=0.01;
CPT(1,1,3)=0.01;
CPT(1,1,2)=0.01;
CPT(1,3,3)=0.3;
CPT(1,1,1)=0.98;
CPT(2,2,3)=0.01;
CPT(2,1,3)=0.01;
CPT(2,2,1)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{14} = tabular_CPD(bnet, 14, 'CPT', CPT);
CPT= zeros(2, 2, 3);
CPT(1,2,3)=0.9;
CPT(2,1,2)=0.01;
CPT(1,1,1)=0.95;
CPT(2,2,3)=0.05;
CPT(1,1,2)=0.04;
CPT(1,2,1)=0.01;
CPT(2,1,3)=0.01;
CPT(1,2,2)=0.09;
CPT(2,2,1)=0.05;
CPT(1,1,3)=0.01;
CPT(2,2,2)=0.9;
CPT(2,1,1)=0.98;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{15} = tabular_CPD(bnet, 15, 'CPT', CPT);
CPT= zeros(2, 2, 3);
CPT(2,1,3)=0.01;
CPT(1,1,2)=0.01;
CPT(1,1,1)=0.98;
CPT(2,2,3)=0.05;
CPT(2,1,2)=0.04;
CPT(1,2,1)=0.5;
CPT(1,2,3)=0.01;
CPT(2,2,2)=0.9;
CPT(2,2,1)=0.05;
CPT(1,1,3)=0.01;
CPT(1,2,2)=0.49;
CPT(2,1,1)=0.95;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{16} = tabular_CPD(bnet, 16, 'CPT', CPT);
CPT= zeros(2, 2);
CPT(2,1)=0.01;
CPT(1,2)=0.1;
CPT(1,1)=0.9;
CPT(2,2)=0.99;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{17} = tabular_CPD(bnet, 17, 'CPT', CPT);
CPT= zeros(2, 3, 4, 4);
CPT(2,1,2,4)=0.01;
CPT(1,3,2,2)=0.03;
CPT(2,2,4,1)=0.97;
CPT(2,1,4,1)=0.01;
CPT(2,2,2,3)=0.01;
CPT(1,1,1,3)=0.01;
CPT(2,3,3,4)=0.01;
CPT(1,1,4,1)=0.3;
CPT(1,1,1,1)=0.97;
CPT(2,2,2,1)=0.97;
CPT(2,3,4,3)=0.01;
C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1,1,1)=0.97;
CPT(1,4,3)=0.01;
CPT(3,4,3)=0.01;
CPT(2,1,1)=0.97;
CPT(2,4,1)=0.5;
CPT(2,4,4)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{20} = tabular_CPD(bnet, 20, 'CPT', CPT);
CPT= zeros(3, 4, 4);
CPT(3,4,2)=0.88;
CPT(1,4,1)=0.01;
CPT(3,1,4)=0.01;
CPT(2,3,1)=0.01;
CPT(2,3,3)=0.97;
CPT(3,3,4)=0.01;
CPT(3,3,3)=0.04;
CPT(1,2,2)=0.97;
CPT(3,1,3)=0.01;
CPT(1,4,3)=0.01;
CPT(2,1,4)=0.01;
CPT(2,1,3)=0.01;
CPT(2,1,1)=0.97;
CPT(2,3,4)=0.01;
CPT(3,2,3)=0.01;
CPT(3,3,1)=0.01;
CPT(1,3,2)=0.01;
CPT(2,3,2)=0.01;
CPT(2,2,4)=0.01;
CPT(2,4,2)=0.01;
CPT(3,1,1)=0.97;
CPT(3,4,1)=0.01;
CPT(1,4,2)=0.01;
CPT(1,1,2)=0.01;
CPT(2,4,1)=0.01;
CPT(3,2,1)=0.03;
CPT(3,4,4)=0.01;
CPT(1,2,4)=0.01;
CPT(1,4,4)=0.97;
CPT(1,1,4)=0.01;
CPT(3,2,2)=0.95;
CPT(1,3,1)=0.01;
CPT(1,3,3)=0.97;
CPT(2,4,4)=0.97;
CPT(3,4,3)=0.1;
CPT(2,1,2)=0.01;
CPT(2,4,3)=0.01;
CPT(1,3,4)=0.01;
CPT(1,1,3)=0.01;
CPT(3,3,2)=0.94;
CPT(1,2,1)=0.01;
CPT(1,1,1)=0.97;
CPT(1,2,3)=0.01;
CPT(3,1,2)=0.01;
CPT(2,2,1)=0.01;
CPT(2,2,3)=0.01;
CPT(3,2,4)=0.01;
CPT(2,2,2)=0.97;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{21} = tabular_CPD(bnet, 21, 'CPT', CPT);
CPT= zeros(3, 2, 2);
CPT(2,1,2)=0.9;
CPT(1,2,1)=0.95;
CPT(3,1,2)=0.99;
CPT(3,2,2)=0.95;
CPT(3,2,1)=0.05;
CPT(1,2,2)=0.05;
CPT(2,1,1)=0.1;
CPT(3,1,1)=0.01;
CPT(2,2,2)=0.05;
CPT(1,1,2)=0.9;
CPT(1,1,1)=0.1;
CPT(2,2,1)=0.95;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{22} = tabular_CPD(bnet, 22, 'CPT', CPT);
CPT= zeros(3, 4);
CPT(3,4)=0.97;
CPT(1,3)=0.01;
CPT(1,4)=0.01;
CPT(3,3)=0.01;
CPT(2,4)=0.01;
CPT(2,3)=0.97;
CPT(3,1)=0.01;
CPT(2,1)=0.01;
CPT(1,1)=0.01;
CPT(1,2)=0.97;
CPT(3,2)=0.01;
CPT(2,2)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{23} = tabular_CPD(bnet, 23, 'CPT', CPT);
CPT= zeros(2, 4, 3);
CPT(2,4,3)=0.98;
CPT(1,2,1)=0.98;
CPT(1,2,3)=0.01;
CPT(2,3,1)=0.01;
CPT(2,3,3)=0.04;
CPT(1,3,3)=0.01;
CPT(1,2,2)=0.01;
CPT(2,4,1)=0.01;
CPT(2,3,2)=0.95;
CPT(2,1,2)=0.01;
CPT(2,4,2)=0.01;
CPT(1,1,3)=0.01;
CPT(1,3,2)=0.04;
CPT(1,1,2)=0.01;
CPT(2,1,3)=0.01;
CPT(2,2,2)=0.01;
CPT(1,4,1)=0.95;
CPT(2,1,1)=0.98;
CPT(1,3,1)=0.95;
CPT(1,1,1)=0.98;
CPT(2,2,1)=0.98;
CPT(1,4,2)=0.04;
CPT(2,2,3)=0.01;
CPT(1,4,3)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{24} = tabular_CPD(bnet, 24, 'CPT', CPT);
CPT= zeros(2, 3, 3, 3, 2);
CPT(1,1,1,1,2)=0.99;
CPT(2,1,1,3,1)=0.95;
C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,1,1)=0.05;
CPT(1,2,2,2,1)=0.01;
CPT(1,3,2,3,2)=0.95;
CPT(2,2,3,2,2)=0.7;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{25} = tabular_CPD(bnet, 25, 'CPT', CPT);
CPT= zeros(2, 3);
CPT(2,2)=0.9;
CPT(2,3)=0.05;
CPT(2,1)=0.05;
CPT(1,3)=0.8;
CPT(1,1)=0.01;
CPT(1,2)=0.19;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{26} = tabular_CPD(bnet, 26, 'CPT', CPT);
CPT= zeros(2, 3);
CPT(1,2)=0.01;
CPT(2,1)=0.3;
CPT(2,3)=0.3;
CPT(2,2)=0.4;
CPT(1,3)=0.01;
CPT(1,1)=0.98;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{27} = tabular_CPD(bnet, 27, 'CPT', CPT);
CPT= zeros(2, 3, 3);
CPT(2,2,3)=0.01;
CPT(2,2,2)=0.98;
CPT(1,2,1)=0.333333;
CPT(1,2,2)=0.333333;
CPT(2,3,1)=0.01;
CPT(2,1,2)=0.01;
CPT(2,1,3)=0.01;
CPT(2,1,1)=0.98;
CPT(1,3,2)=0.333333;
CPT(2,3,2)=0.01;
CPT(1,3,1)=0.333333;
CPT(1,1,2)=0.333333;
CPT(1,1,1)=0.333333;
CPT(1,2,3)=0.333333;
CPT(1,1,3)=0.333333;
CPT(2,2,1)=0.01;
CPT(1,3,3)=0.333333;
CPT(2,3,3)=0.98;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{28} = tabular_CPD(bnet, 28, 'CPT', CPT);
CPT= zeros(2, 3, 3);
CPT(1,2,1)=0.333333;
CPT(2,1,2)=0.01;
CPT(2,3,3)=0.98;
CPT(2,3,2)=0.01;
CPT(2,1,3)=0.01;
CPT(1,3,3)=0.333333;
CPT(1,2,3)=0.333333;
CPT(1,1,3)=0.333333;
CPT(2,3,1)=0.01;
CPT(2,2,1)=0.01;
CPT(1,1,1)=0.333333;
CPT(2,2,3)=0.01;
CPT(1,3,1)=0.333333;
CPT(1,1,2)=0.333333;
CPT(2,2,2)=0.98;
CPT(1,2,2)=0.333333;
CPT(1,3,2)=0.333333;
CPT(2,1,1)=0.98;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{29} = tabular_CPD(bnet, 29, 'CPT', CPT);
CPT= zeros(3, 3);
CPT(2,3)=0.01;
CPT(3,1)=0.01;
CPT(1,2)=0.04;
CPT(3,3)=0.7;
CPT(3,2)=0.29;
CPT(1,1)=0.95;
CPT(1,3)=0.01;
CPT(2,1)=0.04;
CPT(2,2)=0.95;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{30} = tabular_CPD(bnet, 30, 'CPT', CPT);
CPT= zeros(3, 3);
CPT(3,2)=0.04;
CPT(1,1)=0.95;
CPT(1,3)=0.01;
CPT(2,1)=0.04;
CPT(2,2)=0.95;
CPT(2,3)=0.01;
CPT(3,1)=0.01;
CPT(1,2)=0.04;
CPT(3,3)=0.95;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{31} = tabular_CPD(bnet, 31, 'CPT', CPT);
CPT= zeros(3, 3, 3);
CPT(2,2,1)=0.04;
CPT(1,2,3)=0.01;
CPT(3,1,1)=0.3;
CPT(2,2,2)=0.95;
CPT(3,1,3)=0.01;
CPT(2,3,1)=0.01;
CPT(2,2,3)=0.01;
CPT(3,2,3)=0.69;
CPT(2,1,2)=0.04;
CPT(3,3,1)=0.01;
CPT(3,2,2)=0.3;
CPT(1,2,2)=0.04;
CPT(1,3,1)=0.8;
CPT(1,1,2)=0.01;
CPT(1,3,2)=0.19;
CPT(3,2,1)=0.01;
CPT(1,1,3)=0.01;
CPT(1,1,1)=0.98;
CPT(2,3,3)=0.95;
CPT(1,2,1)=0.95;
CPT(2,3,2)=0.04;
CPT(3,3,2)=0.01;
CPT(1,3,3)=0.01;
CPT(3,1,2)=0.69;
CPT(2,1,1)=0.95;
CPT(3,3,3)=0.98;
CPT(2,1,3)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{32} = tabular_CPD(bnet, 32, 'CPT', CPT);
CPT= zeros(4, 3, 4);
CPT(1,3,2)=0.01;
CPT(4,1,1)=0.01;
CPT(3,1,4)=0.01;
CPT(3,1,2)=0.97;
CPT(1,1,3)=0.01;
CPT(4,1,4)=0.01;
CPT(4,2,4)=0.01;
CPT(2,2,1)=0.01;
CPT(4,3,3)=0.01;
CPT(2,3,1)=0.01;
CPT(3,3,3)=0.01;
CPT(4,3,4)=0.97;
CPT(4,3,1)=0.01;
CPT(4,2,1)=0.01;
CPT(4,2,2)=0.01;
CPT(3,1,3)=0.01;
CPT(1,2,2)=0.01;
CPT(3,2,1)=0.01;
CPT(3,3,1)=0.01;
CPT(1,3,1)=0.97;
CPT(2,3,4)=0.97;
CPT(3,1,1)=0.01;
CPT(2,1,4)=0.01;
CPT(4,2,3)=0.97;
CPT(4,1,2)=0.97;
CPT(2,3,3)=0.01;
CPT(1,3,3)=0.01;
CPT(2,3,2)=0.01;
CPT(2,1,1)=0.01;
CPT(1,1,4)=0.01;
CPT(4,1,3)=0.01;
CPT(1,3,4)=0.01;
CPT(1,2,4)=0.01;
CPT(3,2,4)=0.01;
CPT(3,2,2)=0.01;
CPT(4,3,2)=0.01;
CPT(2,1,3)=0.01;
CPT(3,3,4)=0.97;
CPT(3,2,3)=0.97;
CPT(1,1,2)=0.01;
CPT(1,2,3)=0.01;
CPT(2,1,2)=0.97;
CPT(2,2,3)=0.97;
CPT(2,2,4)=0.01;
CPT(1,2,1)=0.97;
CPT(1,1,1)=0.97;
CPT(3,3,2)=0.01;
CPT(2,2,2)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{33} = tabular_CPD(bnet, 33, 'CPT', CPT);
CPT= zeros(4, 3);
CPT(2,1)=0.01;
CPT(3,1)=0.04;
CPT(1,2)=0.01;
CPT(4,1)=0.9;
CPT(2,2)=0.01;
CPT(3,2)=0.92;
CPT(1,1)=0.01;
CPT(2,3)=0.98;
CPT(4,2)=0.09;
CPT(1,3)=0.98;
CPT(4,3)=0.01;
CPT(3,3)=0.04;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{34} = tabular_CPD(bnet, 34, 'CPT', CPT);
CPT= zeros(2, 3, 3);
CPT(2,1,2)=0.01;
CPT(2,2,1)=0.98;
CPT(2,3,2)=0.3;
CPT(1,2,2)=0.98;
CPT(2,1,3)=0.01;
CPT(1,2,3)=0.01;
CPT(2,2,3)=0.01;
CPT(2,3,3)=0.01;
CPT(2,3,1)=0.69;
CPT(1,1,3)=0.01;
CPT(1,3,2)=0.01;
CPT(1,3,3)=0.98;
CPT(1,1,2)=0.01;
CPT(1,3,1)=0.01;
CPT(2,1,1)=0.98;
CPT(1,1,1)=0.98;
CPT(2,2,2)=0.01;
CPT(1,2,1)=0.01;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{35} = tabular_CPD(bnet, 35, 'CPT', CPT);
CPT= zeros(2, 3);
CPT(2,1)=0.01;
CPT(2,3)=0.9;
CPT(1,3)=0.01;
CPT(1,2)=0.89;
CPT(1,1)=0.1;
CPT(2,2)=0.09;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{36} = tabular_CPD(bnet, 36, 'CPT', CPT);
CPT= zeros(3, 3, 3);
CPT(1,2,2)=0.01;
CPT(1,2,1)=0.98;
CPT(3,2,1)=0.05;
CPT(3,1,3)=0.1;
CPT(2,2,2)=0.85;
CPT(1,1,3)=0.01;
CPT(2,3,1)=0.05;
CPT(2,2,1)=0.1;
CPT(3,1,2)=0.6;
CPT(2,1,1)=0.98;
CPT(2,1,2)=0.01;
CPT(2,2,3)=0.05;
CPT(1,1,1)=0.98;
CPT(3,3,1)=0.01;
CPT(2,1,3)=0.01;
CPT(3,2,3)=0.55;
CPT(3,1,1)=0.3;
CPT(3,2,2)=0.4;
CPT(2,3,2)=0.2;
CPT(1,1,2)=0.01;
CPT(2,3,3)=0.75;
CPT(1,2,3)=0.01;
CPT(1,3,3)=0.01;
CPT(3,3,2)=0.09;
CPT(3,3,3)=0.9;
CPT(1,3,2)=0.09;
CPT(1,3,1)=0.9;
CPT=reshape(CPT, 1, prod(size(CPT)));
bnet.CPD{37} = tabular_CPD(bnet, 37, 'CPT', CPT);
